<?php
// no direct access
defined('_JEXEC') or die;
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;
if ( $detect->isMobile() ) {
    include('default_mobile.php');
    return;
}
?>
<script type="text/javascript">
function isValidEmail(emailAddress) {
	   
    var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
 
    return pattern.test(emailAddress);
 
    }
function check()
  {
      var temp=0; 
	  if(jQuery("#navn").val()=='') 
	  { 
	    	 jQuery("#navn").attr('style','border:1px solid red');
	    	 temp=1;
	    	 
	  }
	  else
		  jQuery("#navn").attr('style','border:0px solid red');


	  if(jQuery("#enme").val()=='') 
	  { 
	    	 jQuery("#enme").attr('style','border:1px solid red');
	    	 temp=1;
	    	 
	  }
	  else
		  jQuery("#enme").attr('style','border:0px solid red');


	 


	  

	  	  

	  	  

	  if(!isValidEmail(jQuery("#email").val())) 
	  { 
	    	 jQuery("#email").attr('style','border:1px solid red');
	    	 temp=1;
	    	 
	  }
	  else
		jQuery("#email").attr('style','border:0px solid red');  


	  if(jQuery("#bas").val()=='') 
	  { 
	    	 jQuery("#bas").attr('style','border:1px solid red');
	    	 temp=1;
	    	 
	  }
	  else
		jQuery("#bas").attr('style','border:0px solid red');  

      if(temp==0)
	   jQuery('#contact-form').submit();    
  }


</script>
<?php 
  //print_r($this->contact->misc);
?>
<div class="wrapper">
	<div class="content" id="contact-page">
		<div class="col-wrapper clearfix">
			<div class="col-2 col-cfg">
				<h1 class="hd">Spørgsmål</h1>
				<?php 
				  $dbo=JFactory::getDbo();
				  $query="select * from #__content where catid=9";
				  $dbo->setQuery($query);
				  $row=$dbo->loadObjectList();
				  //print_r($row);
				?>
				<?php foreach ($row as $item){?>
				  <div class="box-question">
					<p class="p-question"><span><?php echo $item->title?></span>  </p>
					<div class="box-answer">
					  <?php echo $item->introtext;?>
					</div>
				</div>
				
				<?php }?>
				
			</div>
			<div class="col-2 col-cfg col-last">
				<h1 class="hd">Kontakt</h1>
				 <?php echo $this->contact->misc;?> 
				
				<div class="clr"></div>
				<div class="box-contact-full">
					<div class="form1-wrapper clearfix">
						<form id="contact-form" action="<?php echo JRoute::_('index.php'); ?>" method="post" class="form-validate">
				              <div class="eachInput">
							<label for="">Navn <span class="red">*</span></label>
							<input type="text" class="i-s-2" name="jform[contact_name]" id="navn">
						</div>
						<div class="eachInput">
							<label for="">Enme <span class="red">*</span></label>
							<input type="text" class="i-s-2" name="jform[contact_subject]" id="enme">
						</div>
						<div class="eachInput">
							<label for="">E-mail <span class="red">*</span></label>
							<input type="text" class="i-s-2" name="jform[contact_email]" id="email">
						</div>
						<div class="eachInput">
							<label for="">Besked <span class="red">*</span></label>
							<textarea name="jform[contact_message]" id="bas" cols="30" rows="10"></textarea>
						</div>
						<div class="formSubmit clearfix">
							<a href="javascript:void(0)" id="btnSend" class="btnCSS" onclick="check();">SEND</a>
						</div>
					<!--<input type="hidden" name="option" value="com_content" />-->
					<!--<input type="hidden" name="view" value="article" />-->
					<!--<input type="hidden" name="id" value="16" />-->
					<input type="hidden" name="option" value="com_contact" />
					<input type="hidden" name="task" value="contact.submit" />
					<input type="hidden" name="return" value="<?php echo $this->return_page;?>" />
					<input type="hidden" name="id" value="<?php echo $this->contact->slug; ?>" />
					<?php echo JHtml::_( 'form.token' ); ?>
	</form>
						<!--  
						<div class="eachInput">
							<label for="">Navn <span class="red">*</span></label>
							<input type="text" class="i-s-2">
						</div>
						<div class="eachInput">
							<label for="">Enme <span class="red">*</span></label>
							<input type="text" class="i-s-2">
						</div>
						<div class="eachInput">
							<label for="">E-mail <span class="red">*</span></label>
							<input type="text" class="i-s-2">
						</div>
						<div class="eachInput">
							<label for="">Besked <span class="red">*</span></label>
							<textarea name="" id="" cols="30" rows="10"></textarea>
						</div>
						<div class="formSubmit clearfix">
							<a href="#" id="btnSend" class="btnCSS">SEND</a>
						</div> -->
					</div>
				</div>
			</div>



		</div>
	</div>
</div>
<?php
return;
/**
 * @package		Joomla.Site
 * @subpackage	com_contact
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$cparams = JComponentHelper::getParams ('com_media');
?>
	
<div id="custom-page-heading">
	<h1 class="heading"><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
</div>
<h2 class="heading-icon ig-user"><?php echo $this->escape($this->params->get('page_heading')); ?></h2>
<?php echo $this->contact->misc; ?>  


<?php return; ?>
<div class="contact<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
	<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
	<?php if ($this->contact->name && $this->params->get('show_name')) : ?>
		<h2>
			<span class="contact-name"><?php echo $this->contact->name; ?></span>
		</h2>
	<?php endif;  ?>
	<?php if ($this->params->get('show_contact_category') == 'show_no_link') : ?>
		<h3>
			<span class="contact-category"><?php echo $this->contact->category_title; ?></span>
		</h3>
	<?php endif; ?>
	<?php if ($this->params->get('show_contact_category') == 'show_with_link') : ?>
		<?php $contactLink = ContactHelperRoute::getCategoryRoute($this->contact->catid);?>
		<h3>
			<span class="contact-category"><a href="<?php echo $contactLink; ?>">
				<?php echo $this->escape($this->contact->category_title); ?></a>
			</span>
		</h3>
	<?php endif; ?>
	<?php if ($this->params->get('show_contact_list') && count($this->contacts) > 1) : ?>
		<form action="#" method="get" name="selectForm" id="selectForm">
			<?php echo JText::_('COM_CONTACT_SELECT_CONTACT'); ?>
			<?php echo JHtml::_('select.genericlist',  $this->contacts, 'id', 'class="inputbox" onchange="document.location.href = this.value"', 'link', 'name', $this->contact->link);?>
		</form>
	<?php endif; ?>
	<?php  if ($this->params->get('presentation_style')!='plain'){?>
		<?php  echo  JHtml::_($this->params->get('presentation_style').'.start', 'contact-slider'); ?>
	<?php  echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_DETAILS'), 'basic-details'); } ?>
	<?php if ($this->params->get('presentation_style')=='plain'):?>
		<?php  echo '<h3>'. JText::_('COM_CONTACT_DETAILS').'</h3>';  ?>
	<?php endif; ?>
	<?php if ($this->contact->image && $this->params->get('show_image')) : ?>
		<div class="contact-image">
			<?php echo JHtml::_('image', $this->contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle')); ?>
		</div>
	<?php endif; ?>

	<?php if ($this->contact->con_position && $this->params->get('show_position')) : ?>
		<p class="contact-position"><?php echo $this->contact->con_position; ?></p>
	<?php endif; ?>

	<?php echo $this->loadTemplate('address'); ?>

	<?php if ($this->params->get('allow_vcard')) :	?>
		<?php echo JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS');?>
			<a href="<?php echo JRoute::_('index.php?option=com_contact&amp;view=contact&amp;id='.$this->contact->id . '&amp;format=vcf'); ?>">
			<?php echo JText::_('COM_CONTACT_VCARD');?></a>
	<?php endif; ?>
	<p></p>
	<?php if ($this->params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) : ?>

		<?php if ($this->params->get('presentation_style')!='plain'):?>
			<?php  echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_EMAIL_FORM'), 'display-form');  ?>
		<?php endif; ?>
		<?php if ($this->params->get('presentation_style')=='plain'):?>
			<?php  echo '<h3>'. JText::_('COM_CONTACT_EMAIL_FORM').'</h3>';  ?>
		<?php endif; ?>
		<?php  echo $this->loadTemplate('form');  ?>
	<?php endif; ?>
	<?php if ($this->params->get('show_links')) : ?>
		<?php echo $this->loadTemplate('links'); ?>
	<?php endif; ?>
	<?php if ($this->params->get('show_articles') && $this->contact->user_id && $this->contact->articles) : ?>
		<?php if ($this->params->get('presentation_style')!='plain'):?>
			<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('JGLOBAL_ARTICLES'), 'display-articles'); ?>
			<?php endif; ?>
			<?php if  ($this->params->get('presentation_style')=='plain'):?>
			<?php echo '<h3>'. JText::_('JGLOBAL_ARTICLES').'</h3>'; ?>
			<?php endif; ?>
			<?php echo $this->loadTemplate('articles'); ?>
	<?php endif; ?>
	<?php if ($this->params->get('show_profile') && $this->contact->user_id && JPluginHelper::isEnabled('user', 'profile')) : ?>
		<?php if ($this->params->get('presentation_style')!='plain'):?>
			<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_PROFILE'), 'display-profile'); ?>
		<?php endif; ?>
		<?php if ($this->params->get('presentation_style')=='plain'):?>
			<?php echo '<h3>'. JText::_('COM_CONTACT_PROFILE').'</h3>'; ?>
		<?php endif; ?>
		<?php echo $this->loadTemplate('profile'); ?>
	<?php endif; ?>
	<?php if ($this->contact->misc && $this->params->get('show_misc')) : ?>
		<?php if ($this->params->get('presentation_style')!='plain'){?>
			<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_OTHER_INFORMATION'), 'display-misc');} ?>
		<?php if ($this->params->get('presentation_style')=='plain'):?>
			<?php echo '<h3>'. JText::_('COM_CONTACT_OTHER_INFORMATION').'</h3>'; ?>
		<?php endif; ?>
				<div class="contact-miscinfo">
					<div class="<?php echo $this->params->get('marker_class'); ?>">
						<?php echo $this->params->get('marker_misc'); ?>
					</div>
					<div class="contact-misc">
						<?php echo $this->contact->misc; ?>
					</div>
				</div>
	<?php endif; ?>
	<?php if ($this->params->get('presentation_style')!='plain'){?>
			<?php echo JHtml::_($this->params->get('presentation_style').'.end');} ?>
</div>
<!--contact-->